package com.mdb.open.epay.domain.dto.epay;

import cn.hutool.core.date.DatePattern;
import com.mdb.bc.api.data.DataObjectBase;
import com.mdb.bc.validator.annotaion.validation.DateFormat;
import com.mdb.open.epay.enums.type.CcyTypeEnum;
import com.mdb.open.epay.enums.type.CertTypeEnum;
import com.mdb.open.epay.enums.type.CustTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @author liuyi
 * @date 2019/11/14
 **/
@Data
@ApiModel(description="签约dto对象")
public class SignDto extends DataObjectBase {

    private static final long serialVersionUID = 1L;

    /**
     * 客户類型
     */
    @ApiModelProperty(value = "客户類型")
    @NotNull(message = "客户類型不能为空")
    private CustTypeEnum custType;

    /**
     * 签约流水号
     */
    @ApiModelProperty(value = "签约流水号")
    @NotBlank(message = "签约流水号不能为空")
    @Size(max = 20)
    private String signSerialNo;

    /**
     * 銀行卡號
     */
    @ApiModelProperty(value = "銀行卡號")
    @NotBlank(message = "銀行卡號不能为空")
    @Size(min = 12, max = 12, message = "銀行卡號不正確")
    private String bankCardNo;

    /**
     * 持卡人英文名
     */
    @ApiModelProperty(value = "持卡人英文名")
    @NotBlank(message = "持卡人英文名不能为空")
    @Size(max = 256)
    private String bankAccountNameE;

    /**
     * 持卡人中文名
     */
    @ApiModelProperty(value = "持卡人中文名")
    @Size(max = 64)
    private String bankAccountNameC;

    /**
     * 手機區號
     */
    @ApiModelProperty(value = "手機區號")
    @NotBlank(message = "手機區號不能为空")
    @Size(max = 5)
    private String phoneArea;

    /**
     * 手机號
     */
    @ApiModelProperty(value = "手机號")
    @NotBlank(message = "手机號不能为空")
    @Size(min = 8, max = 11)
    private String phoneNo;

    /**
     * 證件類型
     */
    @ApiModelProperty(value = "證件類型")
    @NotNull(message = "證件類型不能为空")
    private CertTypeEnum certType;

    /**
     * 證件號碼
     */
    @ApiModelProperty(value = "證件號碼")
    @NotBlank(message = "證件號碼不能为空")
    @Size(max = 32)
    private String certNo;

    /**
     * 出生日期
     */
    @ApiModelProperty(value = "出生日期")
    @DateFormat(format = DatePattern.PURE_DATE_PATTERN, message = "出生日期不正確")
    private String birthDate;

    /**
     * 簽約幣種 MOP
     */
    @ApiModelProperty(value = "簽約幣種")
    private CcyTypeEnum currency = CcyTypeEnum.MOP;

    /**
     * CVV2
     */
    @ApiModelProperty(value = "CVV2")
    @Size(max = 8)
    private String cvv2;

    /**
     * 有效期
     */
    @ApiModelProperty(value = "有效期")
    @Size(min = 8, max = 8, message = "有效期不正確")
    @DateFormat(format = DatePattern.PURE_DATE_PATTERN, message = "有效期不正確")
    private String validDate;

    /**
     * 短信驗證碼
     */
    @ApiModelProperty(value = "短信驗證碼")
    @NotBlank(message = "短信驗證碼不能为空")
    @Size(min = 6, max = 6, message = "短信驗證碼不正確")
    private String msgCode;
}